package com.csxh.web.handler.bookstore;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.csxh.web.service.bookstore.UserServiceEx;

@Controller
@RequestMapping("/user")
public class UserHandler {

	@Autowired
	private UserServiceEx userService;
	
	//表单的字段名称与形参数名称相等
	@RequestMapping("/login")
	public String login(String username,String password,HttpServletRequest req){
		boolean b=this.userService.loginSuccess(username, password);
		if(b){			
			return "success";
		}else{
			return "fail";
		}
	}
}
